package net.dgg.dggcloud.service.jrcrm.service.orf;

import net.dgg.dggcloud.core.minidao.hibernate.dao.IGenericBaseCommonDao;
import net.dgg.dggcloud.service.common.base.service.BaseService;
import net.dgg.dggcloud.service.jrcrm.dao.orf.PayCostRecordDao;
import net.dgg.dggcloud.service.jrcrm.dao.orf.PerformanceDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 财务 成本
 *
 * @author 郭伟 2017/11/2
 */
@Service
public class PayCostRecordService extends BaseService {

    @Autowired
    private PayCostRecordDao payCostRecordDao;

    @Resource(name="miniDaoHiberCommonDao")
    protected IGenericBaseCommonDao repository;


    /**
     *   根据
     * @param map
     *  type 成本类型 1 退款 ，2 核款
     *  status  1 外部 2 内部
     *  costId 科目标识
     *  paymentId 财务ID
     * @return
     */
    public List<Map> listPayCostRecordMap(Map map) {
       return payCostRecordDao.listPayCostRecordMap(map);
    }


    /**
     *  status  1 外部 2 内部
     *  orderBusinessId 子订单ID
     * @param map
     * @return
     */
    public List<Map> getCostSum(Map map){
        return payCostRecordDao.getCostSum(map);
    };

    /**
     *  status  1 外部 2 内部
     *  orderBusinessId 子订单ID
     *  paymentId 财务ID
     * @param map
     * @return
     */
    public List<Map> getUpdateReimburseCostSum(Map map){
        return payCostRecordDao.getUpdateReimburseCostSum(map);
    };

}
